<template>
    <div>
 
        <h2>login组件</h2>
<br>
<button @click="getLogin1">C1</button>
<button @click="getLogin2">C2</button>
<br>
<RouterView></RouterView>
    </div>
</template>
 
<script lang="ts" setup>
 
 import {useRouter,RouterView} from 'vue-router'
const router=useRouter()
const getLogin1=()=>{
router.push("/c1")
}
const getLogin2=()=>{
router.push(
    {
        name:'C2',
        params:{
            name:'张三',
            age:20
        },
        query:{
            name:'张三',
            age:20
        }

    }
)
}

 
 
</script>
 
<style  scoped>
 
</style>